#include <iostream>
#include <string>
#include "process.cpp"

using namespace std;

int main() {
  char trace[256] = "t1.trace";
  char trace1[256] = "t2.trace";
  char trace2[256] = "t3.trace";

  cout << "Starting..." << endl;

  Process* p = new Process(1, 5, 0, trace);
  Process* p1 = new Process(2, 4, 0, trace1);
  Process* p2 = new Process(3, 3, 0, trace2);

  ProcessReturn run_output;
  run_output.ret = RET_SUCCESS;

  cout << "Running..." << endl;

  while (run_output.ret != RET_TERMINATED) {
    cout << "t1.trace" << endl;
    run_output = p->run();
    cout << "Run output: " << run_output.ret << endl;

    cout << "t2.trace" << endl;
    run_output = p1->run();
    cout << "Run output: " << run_output.ret << endl;

    cout << "t3.trace" << endl;
    run_output = p2->run();
    cout << "Run output: " << run_output.ret << endl;
  }

  p->close();
  p1->close();
  p2->close();
}
